package com.sunny.myproject.produce.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sunny.myproject.core.base.action.BaseAction;
import com.sunny.myproject.produce.entity.Mrp;
import com.sunny.myproject.produce.service.MrpService;

/**
 * produce_order
 * @author sunny_nie
 *
 */
@Controller
@RequestMapping("/produce/produceOrder")
public class ProudceOrderAction extends BaseAction<Mrp>{

	private Logger logger = Logger.getLogger(ProudceOrderAction.class);
	private String title = "生产计划";
	private String action = "produce/produceOrder";
	private String function = "produceOrder";
	
	@Autowired
	private MrpService service;
	@Override
	public String add(HttpServletRequest arg0, HttpServletResponse arg1) {
		return null;
	}

	@Override
	public String delete(HttpServletRequest arg0, HttpServletResponse arg1) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String edit(Model arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	@RequestMapping(params="list")
	public String list(Model arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		try {
			super.pager = super.pageStart(arg0, arg1, arg2, action, function,
					title);
			super.pager = super.pageEnd(arg0, service.num(criterions), pager);
			super.returnValue(arg0, service.find(criterions, pager));
		} catch (Exception e) {
			logger.error(e);
		}
		return "produce/produceOrderList";
	}

	@Override
	public String save(HttpServletRequest arg0, HttpServletResponse arg1,
			Mrp arg2) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String view(Model arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		// TODO Auto-generated method stub
		return null;
	}

}
